Skip to content

fix(worker): route mock agent diagnostics through logger#12

Merged
zebbern merged 1 commit into
mainfrom
codex/quiet-mock-agent-logs
Jun 20, 2026
Merged

fix(worker): route mock agent diagnostics through logger#12
zebbern merged 1 commit into
mainfrom
codex/quiet-mock-agent-logs

Conversation

@zebbern

@zebbern zebbern commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • route mock.agent diagnostic messages through context.logger.info instead of raw console.log
  • keep diagnostics available to execution log collectors without default test/pre-push terminal noise
  • add a regression test that fails if the component writes diagnostics directly to console.log

Verification

  • red test first: bun test worker/src/components/dev/__tests__/mock-agent.test.ts failed with 3 console.log calls
  • bun test worker/src/components/dev/__tests__/mock-agent.test.ts
  • bun test worker/src/components/dev
  • git diff --check
  • bun run lint
  • bun run typecheck
  • bun run test
  • bunx tsc --build worker --force && bun run typecheck after full test cleanup
  • git push -u origin codex/quiet-mock-agent-logs pre-push hook

Signed-off-by: zebbern <185730623+zebbern@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 17:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the worker’s mock.agent debug component to route its diagnostic output through the component execution logger (context.logger.info) rather than writing directly to console.log, and adds a regression test to prevent reintroducing console-based diagnostics. This aligns the component’s diagnostics with the worker’s execution-log collection path while reducing default terminal noise during local test/pre-push runs.

Changes:

  • Replaced direct console.log diagnostics in mock.agent with context.logger.info via a small logDiagnostic() helper.
  • Added a unit test asserting the component does not call console.log and that diagnostics flow through the provided execution logger.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
worker/src/components/dev/mock-agent.ts Routes mock-agent diagnostics through context.logger.info instead of console.log.
worker/src/components/dev/__tests__/mock-agent.test.ts Adds a regression test that fails if diagnostics are written via console.log.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zebbern zebbern merged commit f03e0ec into main Jun 20, 2026
6 checks passed
@zebbern zebbern deleted the codex/quiet-mock-agent-logs branch June 20, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants